
/**
 * @param { get: params }
 * @param {post: data }
 * 
*/
import fetch from './request'

export const getLogin = (data) => {
  return fetch.post('/api/login', data)
}

export const getAdd = (data) => {
  // console.log(data, 'data')
  return fetch.post('/api/add', data)
}

export const getDelete = (id) => {
  return fetch.delete(`/api/delete/${id}`)
}

export const getDeleteAll = (ids) => {
  return fetch.delete(`/api/deleteAll/${ids}`)
}

export const getSearch = (params) => {
  return fetch.get(`/api/search/${ids}`, { params: { ...params } })
}

export const getPage = (params) => {
  // console.log(params, 'params')
  return fetch.get(`/api/page`, { params: { ...params } })
}

export const getUpdate = (data, id) => {
  return fetch.put(`/api/update/${id}`, data)
}

export const getFindAll = () => {
  return fetch.get(`/api/findAll`)
}


export const getMyUrl = () => {
  return fetch.get('/api/myUrl')
}